package com.yoga.service.impl;

import com.yoga.entity.YogaUser;
import com.yoga.entity.YogaUserExample;
import com.yoga.mapper.YogaTransactionDao;
import com.yoga.mapper.YogaUserDao;
import com.yoga.service.PhotoUploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class PhotoUploadServiceImpl implements PhotoUploadService {
    @Autowired
    private YogaUserDao yogaUserDao;
    @Override
    public boolean addPhoto(Integer uid, String url) {
        YogaUser yogaUser = yogaUserDao.selectByPrimaryKey(uid);
        yogaUser.setPhoto(url);
        yogaUserDao.updateByPrimaryKeySelective(yogaUser);
        return true;
    }

    @Override
    public YogaUser findOne(Integer uid) {
        return yogaUserDao.selectByPrimaryKey(uid);
    }
}
